{extend name="mainadmin@layouts/base" /}
{block name="head" }
<link rel="stylesheet" href="__STATIC__/js/jquery/jquery_ui/jquery-ui.css">
<script src="__STATIC__/js/jquery/jquery_ui/jquery-ui.js"></script>
<style>
    @font-face{

        　　font-family:'msyhbd';
        　　src:url('__STATIC__/share/msyhbd.ttc');

    }
    #share_img_box{
        font-family:'msyhbd';
        width:375px;border: 1px solid #000;
        overflow: hidden;
        position: relative;
    }
    #share_bg_img{width: 100%;}

    #share_img_box .share_goods_img,#share_img_box .share_goods_name,#share_img_box .share_goods_price{position: absolute; z-index: auto; user-select: auto;}

    #share_img_box .share_qrcode{ border: 1px dashed #000;position: absolute; z-index: auto; user-select: auto;}
    #share_img_box .share_avatar{position: absolute;cursor:default;  border:1px dashed #000;position: absolute; z-index: auto; user-select: auto;}
    #share_img_box .share_nick_name{position: absolute;cursor:default; border:1px dashed #000;position: absolute;font-weight: bold;z-index: auto; user-select: auto;}
    .circle{border-radius: 50%;}
    #share_img_box .share_avatar span{
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        font-size: 12px;
        background-color: #ddd;
        overflow: hidden;
    }
</style>
{/block}
{block name="main" }
<header class="header  b-b clearfix">
     <div class="page-breadcrumbs">
            <ul class="breadcrumb" >
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>商城设置</strong>
                </li>                                  
            </ul>
      </div>
</header>
<form class="form-horizontal form-validate form_vbox" id="_form" method="post" action="{:url('save')}">
    <section class="vbox">
        <section class="scrollable  wrapper w-f">
            <section class="panel panel-default">
                <header>
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#basic" data-toggle="tab">基本配置</a></li>
                        {if condition="$setting.sys_model_shop_bonus == 1"}
                        <li><a href="#bonus" data-toggle="tab">优惠券设置</a></li>
                        {/if}
                        {if condition="$setting.sys_model_shop_fightgroup == 1 && $setting.sys_model_shop_favour == 1"}
                        <li><a href="#favour" data-toggle="tab">限时优惠/拼团设置</a></li>
                        {elseif condition="setting.sys_model_shop_favour == 1"}
                        <li><a href="#favour" data-toggle="tab">限时优惠</a></li>
                        {/if}
                        <li><a href="#share" data-toggle="tab">商品分享设置</a></li>
                    </ul>
                </header>
                <div class="tab-content">
                    <div class="tab-pane active" id="basic">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">超时取消：</label>
                            <div class="controls">
                                <select name="shop_order_auto_cancel" style="width:200px;">
                                    <option value="0" {$setting['shop_order_auto_cancel']==0?'selected':''}>不执行自动取消</option>
                                    <option value="15" {$setting['shop_order_auto_cancel']==15?'selected':''}>15 分钟</option>
                                    <option value="30" {$setting['shop_order_auto_cancel']==30?'selected':''}>30 分钟</option>
                                    {for start="1" end="24" name="time" }
                                    <option value="{$time * 60}" {$setting['shop_order_auto_cancel']==$time * 60?'selected':''}>{$time} 小时</option>
                                    {/for}
                                </select> <span class="help-line">下单成功后超过指定时间未支付自动取消订单</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">自动签收：</label>
                            <div class="controls">
                                <select name="shop_auto_sign_limit">
                                    {for start="1" end="31" name="day" }
                                    <option value="{$day}" {$setting['shop_auto_sign_limit']==$day?'selected':''}>{$day} 天</option>
                                    {/for}
                                </select> <span class="help-line">发货多少天后订单自动签收</span>
                            </div>
                        </div>

                        <div class="form-group hide">
                            <label class="col-sm-2 control-label">申请售后：</label>
                            <div class="controls">
                                <select name="shop_after_sale_limit" class="input-max shop_after_sale_limit" >
                                    <option value="0" {$setting['shop_after_sale_limit']==0?'selected':''}>不启用售后功能</option>
                                    {for start="1" end="31" name="day" }
                                    <option value="{$day}" {$setting['shop_after_sale_limit']==$day?'selected':''}>{$day} 天</option>
                                    {/for}
                                </select> <span class="help-line">签收后多少天内可申请售后</span>
                            </div>
                        </div>
                        <div id="return_info_box" class="{$setting['shop_after_sale_limit']<1?'hide':''}">
                            <div class="line line-dashed line-lg pull-in" style="width:99%;"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">退货收货人：</label>
                                <div class="controls">
                                    <input type="text" name="return_consignee" value="{$setting.return_consignee}"
                                           class="input-large"> <span class="help-line"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">退货联系电话：</label>
                                <div class="controls">
                                    <input type="text" name="return_mobile" value="{$setting.return_mobile}"
                                           class="input-large"> <span class="help-line"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">退货地址：</label>
                                <div class="controls">
                                    <input type="text" name="return_address" value="{$setting.return_address}"
                                           class="input-xxlarge"> <span class="help-line"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">退货说明：</label>
                                <div class="controls">
                                <textarea rows="4" class="input-xxlarge"
                                          name="return_desc">{$setting.return_desc}</textarea>
                                </div>
                            </div>
                        </div>
                        <div class="line line-dashed line-lg pull-in" style="width:99%;"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">减库存的时机：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_reduce_stock" value="0" {$setting['shop_reduce_stock']==0?'checked':''}
                                    type="radio">下单成功时
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_reduce_stock" value="1" {$setting['shop_reduce_stock']==1?'checked':''}
                                    type="radio" >支付成功时
                                </label>
                            </div>
                        </div>
                        <div class="line line-dashed line-lg pull-in" style="width:99%;"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">取消未发货订单：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="order_unshipped_cancel" value="1" {$setting['order_unshipped_cancel']>0?'checked':''}
                                    type="radio">开启
                                </label>
                                <label class="radio-inline">
                                    <input name="order_unshipped_cancel" value="0" {$setting['order_unshipped_cancel']==0?'checked':''}
                                    type="radio" >关闭
                                </label>
                                <span class="help-inline">订单已支付，未发货，是否允许取消</span>
                            </div>
                        </div>

                    </div>

                    <div class="tab-pane " id="bonus">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">开放优惠券：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_used_bonus" value="0" {$setting['shop_used_bonus']<1?'checked':''}
                                    type="radio">关闭
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_used_bonus" value="1" {$setting['shop_used_bonus']==1?'checked':''}
                                    type="radio" >开启
                                </label>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">注册优惠券背景：</label>
                            <div class="controls col-sm-6">
                                <div class="defUpImgBox" data-toggle="uploaderOne">
                                    <img id="img_reg_bonus_bg" src="{$setting.reg_bonus_bg|default='__STATIC__/main/img/image.png'}">
                                    <input id="input_reg_bonus_bg" type="hidden"  name="reg_bonus_bg"  value="{$setting.reg_bonus_bg}">
                                    <div class="tips">点击上传</div>
                                </div>
                                <p>
                                    <span class="help-inline">建议图片尺寸：320*320像素</span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane " id="favour">
                        {if condition="$setting.sys_model_shop_favour == 1"}
                        <header class="panel-heading bg-light">限时优惠相关</header>
                        <div class="form-group m-t">
                            <label class="col-sm-2 control-label">档期间隔：</label>
                            <div class="controls col-lg-3">
                                <select name="favour_time_cycle" class="input-max">
                                    <option value="1" {$setting['favour_time_cycle']==1?'selected':''}>1小时一档</option>
                                    <option value="2" {$setting['favour_time_cycle']==2?'selected':''}>2小时一档</option>
                                    <option value="3" {$setting['favour_time_cycle']==3?'selected':''}>3小时一档</option>
                                </select><span class="help-line">设置一个档期为几个小时，此设置变动后，需要重新选择活动的档期，所以需谨慎操作</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">每日活动开始时间：</label>
                            <div class="controls col-lg-3">
                                <select name="favour_start_time" class="input-max">
                                    {for start="0" end="24" name="time" }
                                    <option value="{$time}" {$setting['favour_start_time']==$time?'selected':''}>{$time}:00</option>
                                    {/for}
                                </select> <span class="help-line">*设置每天限时优惠活动的开始时间，此设置变动后，需要重新选择活动的档期，所以需谨慎操作</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">首页显示商品数量：</label>
                            <div class="controls col-lg-3">
                                <select name="favour_show_num" class="input-max">
                                    <option value="0">不限制数量</option>
                                    {for start="1" end="31" name="num" }
                                    <option value="{$num}" {$setting['favour_show_num']==$num?'selected':''}>{$num}个</option>
                                    {/for}
                                </select> <span class="help-line"></span>
                            </div>
                        </div>

                        <div class="line line-dashed line-lg pull-in"></div>
                        {/if}

                    </div>

                    <div class="tab-pane " id="share">
                        <div class="col-sm-6">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">海报背景图片：</label>
                                <div class="controls col-sm-6">
                                    <div class="defUpImgBox" data-toggle="uploaderOne" data-fun="changeShaerGoodsBg" data-type="image">
                                        <img id="img_share_goods_bg" src="{$setting.share_goods_bg|default='__STATIC__/main/img/image.png'}">
                                        <input id="input_share_goods_bg" type="hidden"  name="share_goods_bg"  value="{$setting.share_goods_bg}">
                                        <div class="tips">点击上传</div>
                                    </div>

                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">商品图片位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_xy" class="input-small"
                                           value="{$setting.share_goods_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">商品图片宽度：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_wh" class="input-small"
                                           value="{$setting.share_goods_wh}" placeholder="格式：w,h"> <span
                                        class="help-line">w：宽度，h：高度(px)像素，只可输入数字</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">商品名称位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_name_xy" class="input-small"
                                           value="{$setting.share_goods_name_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商品名称颜色：</label>
                                <div class="controls minicolors minicolors-theme-bootstrap minicolors-position-bottom minicolors-position-left">
                                    <input type="text" name="share_goods_name_color"
                                           class="form-control colorpicker minicolors-input" style="padding-left: 30px;"
                                           data-control="hue" value="{$setting.share_goods_name_color}" size="7">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商品名称字体：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_name_size" data-rule-digits="true"
                                           data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_name_size}" placeholder=""> <span
                                        class="help-line">(px)像素，只可输入数字</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商品名称换行：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_name_br" data-rule-digits="true"
                                           data-rule-required="true" data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_name_br}" placeholder=""> <span
                                        class="help-line">个字，达到长度即换行，0不换行</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">商品价格位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_price_xy" class="input-small"
                                           value="{$setting.share_goods_price_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商品价格颜色：</label>
                                <div class="controls minicolors minicolors-theme-bootstrap minicolors-position-bottom minicolors-position-left">
                                    <input type="text" name="share_goods_price_color"
                                           class="form-control colorpicker minicolors-input" style="padding-left: 30px;"
                                           data-control="hue" value="{$setting.share_goods_price_color}" size="7">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">商品价格字体：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_price_size" data-rule-digits="true"
                                           data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_price_size}" placeholder=""> <span
                                        class="help-line">(px)像素，只可输入数字</span>
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in " style="width:99%;"></div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">头像位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_avatar_xy" class="input-small"
                                           value="{$setting.share_goods_avatar_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">头像宽度：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_avatar_width" data-rule-digits="true"
                                           data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_avatar_width}"> <span class="help-line">(px)像素，只可输入数字</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">头像形状：</label>
                                <div class="controls">
                                    <div class="controls">
                                        <label class="radio-inline">
                                            <input name="share_goods_avatar_shape" class="share_goods_avatar_shape"
                                                   value="0" {$setting['share_goods_avatar_shape']<=0?'checked':''}
                                            type="radio">圆形
                                        </label>
                                        <label class="radio-inline">
                                            <input name="share_goods_avatar_shape" class="share_goods_avatar_shape"
                                                   value="1" {$setting['share_goods_avatar_shape']==1?'checked':''}
                                            type="radio" >方形
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">呢称位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_nickname_xy" class="input-small"
                                           value="{$setting.share_goods_nickname_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">呢称相对居中：</label>
                                <div class="controls">
                                    <label class="radio-inline">
                                        <input name="share_goods_nickname_center" value="0" {$setting['share_goods_nickname_center']<=0?'checked':''}
                                        type="radio">关闭
                                    </label>
                                    <label class="radio-inline">
                                        <input name="share_goods_nickname_center" value="1" {$setting['share_goods_nickname_center']==1?'checked':''}
                                        type="radio" >开启
                                    </label>
                                    <span class="help-line" style="vertical-align: middle;">x：相对头像居中</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">呢称颜色：</label>
                                <div class="controls minicolors minicolors-theme-bootstrap minicolors-position-bottom minicolors-position-left">
                                    <input type="text" name="share_goods_nickname_color"
                                           class="form-control colorpicker minicolors-input" style="padding-left: 30px;"
                                           data-control="hue" value="{$setting.share_goods_nickname_color}" size="7">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">呢称字体大小：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_nickname_size" data-rule-digits="true"
                                           data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_nickname_size}" placeholder=""> <span
                                        class="help-line">(px)像素，只可输入数字</span>
                                </div>
                            </div>
                            <div class="line line-dashed line-lg pull-in " style="width:99%;"></div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">二维码位置：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_qrcode_xy" class="input-small"
                                           value="{$setting.share_goods_qrcode_xy}" placeholder="格式：x,y"> <span
                                        class="help-line">x：距离左边距离，y：距离顶部距离</span>
                                </div>
                            </div>
                            <div class="form-group hide">
                                <label class="col-sm-1 control-label">二维码宽度：</label>
                                <div class="controls">
                                    <input type="text" name="share_goods_qrcode_width" data-rule-digits="true"
                                           data-rule-required="true" class="input-small"
                                           value="{$setting.share_goods_qrcode_width}"> <span class="help-line">(px)像素，只可输入数字</span>
                                </div>
                            </div>

                        </div>

                        <div class="col-sm-6">
                            <button type="button" class="btn btn-primary" id="show_share_img">点击预览效果，要保存后才能生效</button>
                            <div id="share_img_box">
                                <img src="{$setting.share_goods_bg}" id="share_bg_img">
                                <div class="share_goods_img hide"><img src="__STATIC__/share/goods.jpg"
                                                                       style="width: 100%; height: 100%;"></div>
                                <div class="share_goods_name hide" style="font-weight: bold;">【屈臣氏】新碧双重保湿水感防晒露80克*2件
                                    隔离防晒伤小金帽
                                </div>
                                <div class="share_goods_price hide" style="font-weight: bold;">￥99.00元</div>
                                <div class="share_qrcode hide"><img
                                        src=""
                                        style="width: 100%; height: 100%;"></div>
                                <div class="share_avatar hide"><span
                                        class="{$setting['share_goods_avatar_shape']<=0?'circle':''}">头像</span></div>
                                <div class="share_nick_name hide">邀请者昵称</div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </section>
        <footer class="footer bg-white b-t p-t">
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-1">
                    <button type="submit" class="btn btn-primary js_save_submit" data-loading-text="保存中...">保存
                    </button>
                    <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                </div>
            </div>
        </footer>
    </section>
</form>
{/block}
{block name="footer" }
<script type="text/javascript">
    $('.shop_after_sale_limit').change(function () {
        var val = $(this).val();
        if (val > 0){
            $('#return_info_box').removeClass('hide');
        }else{
            $('#return_info_box').addClass('hide');
        }
    })
    function changeShaerGoodsBg(data){
        $('#share_bg_img').attr("src",data.url);
    }
    $('#show_share_img').click(function () {
        var obj = this;
        $(obj).html('预览图生成中..');
        var data = $('#_form').toJson();
        jq_ajax('{:url("mergeShareImg")}',data,function(){
            $(obj).html('点击预览效果');
            window.open("/upload/share_bg/test_goods_share.jpg?"+ Math.random());
        })
    })
    $(function() {
        //商品图片处理
        $(".share_goods_img").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_xy']").val(ui.position.left+','+ui.position.top);
        }}).resizable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_wh']").val(ui.size.width+','+ui.size.height);
        }})
        var share_goods_xy = '{$setting.share_goods_xy}';
        share_goods_xy = share_goods_xy.split(',');
        var share_goods_wh = '{$setting.share_goods_wh}';
        share_goods_wh = share_goods_wh.split(',');
        $(".share_goods_img").css({
            'left':share_goods_xy[0]+'px',
            'top':share_goods_xy[1]+'px',
            'width':share_goods_wh[0]+'px',
            'height':share_goods_wh[1]+'px',
        }).removeClass('hide');
        //商品名称处理
        $(".share_goods_name").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_name_xy']").val(ui.position.left+','+ui.position.top);
        }});
        var share_goods_name_xy = '{$setting.share_goods_name_xy}';
        share_goods_name_xy = share_goods_name_xy.split(',');
        $(".share_goods_name").css({
                'left':share_goods_name_xy[0]+'px',
                'top':share_goods_name_xy[1]+'px',
                'font-size':{$setting.share_goods_name_size}+'px',
            'color':'{$setting.share_goods_name_color}',
    }).removeClass('hide');
        //监听文本框
        $("input[name='share_goods_name_color").on('input propertychange', function() {
            $(".share_goods_name").css({'color':$(this).val()});

        });
        $("input[name='share_goods_name_size']").on('input propertychange', function() {
            $(".share_goods_name").css({'font-size':$(this).val()+'px'});

        });
        //商品价格处理
        $(".share_goods_price").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_price_xy']").val(ui.position.left+','+ui.position.top);
        }});
        var share_goods_price_xy = '{$setting.share_goods_price_xy}';
        share_goods_price_xy = share_goods_price_xy.split(',');
        $(".share_goods_price").css({
                'left':share_goods_price_xy[0]+'px',
                'top':share_goods_price_xy[1]+'px',
                'font-size':{$setting.share_goods_price_size}+'px',
            'color':'{$setting.share_goods_price_color}',
    }).removeClass('hide');
        //监听文本框
        $("input[name='share_goodsprice_color").on('input propertychange', function() {
            $(".share_goods_price").css({'color':$(this).val()});

        });
        $("input[name='share_goods_price_size']").on('input propertychange', function() {
            $(".share_goods_price").css({'font-size':$(this).val()+'px'});

        });


        //二维码处理
        $(".share_qrcode").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_qrcode_xy']").val(ui.position.left+','+ui.position.top);
        }}).resizable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_qrcode_width']").val(ui.size.width);
            $(".share_qrcode").css({'height':ui.size.width+'px'});
        }})
        var share_goods_qrcode_xy = '{$setting.share_goods_qrcode_xy}';
        share_goods_qrcode_xy = share_goods_qrcode_xy.split(',');
        $(".share_qrcode").css({
                'left':share_goods_qrcode_xy[0]+'px',
                'top':share_goods_qrcode_xy[1]+'px',
                'width':{$setting.share_goods_qrcode_width}+'px',
            'height':{$setting.share_goods_qrcode_width}+'px',
    }).removeClass('hide');
//头像处理
        $(".share_avatar").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_avatar_xy']").val(ui.position.left+','+ui.position.top);
        }}).resizable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_avatar_width").val(ui.size.width);
            $(".share_avatar").css({'height':ui.size.width+'px'});
        }});
        var share_goods_avatar_xy = '{$setting.share_goods_avatar_xy}';
        share_goods_avatar_xy = share_goods_avatar_xy.split(',');
        $(".share_avatar").css({
                'left':share_goods_avatar_xy[0]+'px',
                'top':share_goods_avatar_xy[1]+'px',
                'width':{$setting.share_goods_avatar_width}+'px',
            'height':{$setting.share_goods_avatar_width}+'px',
    }).removeClass('hide');
        $('.share_goods_avatar_shape').click(function () {
            if ($(this).val() == 0){
                if ($(".share_avatar span").hasClass('circle')){
                    return false;
                }
                $(".share_avatar span").addClass('circle');
            }else{
                $(".share_avatar span").removeClass('circle');
            }
        })

        //呢称处理
        $(".share_nick_name").draggable({containment:'#share_img_box',stop: function( event, ui ) {
            //console.log(ui);
            $("input[name='share_goods_nickname_xy").val(ui.position.left+','+ui.position.top);
        }});
        var share_goods_nickname_xy = '{$setting.share_goods_nickname_xy}';
        share_goods_nickname_xy = share_goods_nickname_xy.split(',');
        $(".share_nick_name").css({
                'left':share_goods_nickname_xy[0]+'px',
                'top':share_goods_nickname_xy[1]+'px',
                'font-size':{$setting.share_goods_nickname_size}+'px',
            'color':'{$setting.share_goods_nickname_color}',
    }).removeClass('hide');
        //监听文本框
        $("input[name='share_goods_nickname_color']").on('input propertychange', function() {
            $(".share_nick_name").css({'color':$(this).val()});

        });
        $("input[name='share_goods_nickname_size']").on('input propertychange', function() {
            $(".share_nick_name").css({'font-size':$(this).val()+'px'});

        });
    })
</script>
{/block}